home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #6 / Amiga Plus CD - 2004 - No. 06.iso / AmiSoft / Util / libs / ExtraLib.lha / Extra / Demos / ShowMsgDemo.BAS < prev    next >
BASIC Source File  |  2004-05-30  |  5KB  |  113 lines

  1. ' ___________________________________________________________________________
  2. ' |*************************************************************************|
  3. ' |*|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|*|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|*|
  4. ' |*| Set TAB to 4 for best readable file layout.  |*|  Maxon Basic 3.00  |*|
  5. ' |*|______________________________________________|*|____________________|*|
  6. ' |*************************************************************************|
  7. ' |*|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|*|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|*|
  8. ' |*|               |*|  $Id: ShowMsgDemo.BAS (07.10.03)                  |*|
  9. ' |*| ###### ###### |*|  RhoSigma Source based on NDK 3.1 Includes 40.15  |*|
  10. ' |*| ##  ## ##   # |*| _________________________________________________ |*|
  11. ' |*| ##  ##  ##    |*|                                                   |*|
  12. ' |*| ######   ##   |*|  Demo to show use of extra/ShowMsg() and Macros   |*|
  13. ' |*| ##      ##    |*|                                                   |*|
  14. ' |*| ##     ##   # |*| ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ |*|
  15. ' |*| ##     ###### |*|  Copyright © 1998-2002 RhoSigma, Roland Heyder    |*|
  16. ' |*|               |*|  All Rights Reserved.                             |*|
  17. ' |*|_______________|*|___________________________________________________|*|
  18. ' |*************************************************************************|
  19. ' ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  20.  
  21. '$TO        ShowMsgDemoBAS
  22. '$ICONS
  23. '$NOLIBRARY
  24. '$NOWINDOW
  25.  
  26. '$INCLUDE    exec.bc
  27. '$INCLUDE    settings.bc
  28. '$INCLUDE    extra.bh
  29.  
  30. DATA "$VER: ShowMsgDemoBAS 4.215 (07.10.03)"
  31.  
  32. LIBRARY OPEN "extra",4
  33.  
  34. SMTEXT 100,6,"linke Seite",FALSE&        ' END-Flag FALSE (kein Ende)
  35. SMTEXT 444,6,"rechte Seite",FALSE&         ' absolute X-Koordinaten
  36. SMTEXT SMTPOS_C%,16,"zentriert",FALSE&    ' END-Flag FALSE, zentriert
  37. SMTEXT SMTPOS_C%,26,"Ende",TRUE&        ' END-Flag TRUE (Ende), zentriert
  38. ok&=ShowMsg&(SADD(smAlert$),0&,40&,0&)
  39.  
  40. SMTEXT 112,6,"Oder",FALSE&
  41. SMTEXT 212,6,"alles",FALSE&
  42. SMTEXT 312,6,"in",FALSE&
  43. SMTEXT 412,6,"einer",FALSE&
  44. SMTEXT 512,6,"Zeile !!",TRUE&
  45. ok&=ShowMsg&(SADD(smAlert$),0&,20&,0&)
  46.  
  47. SMTEXT SMTPOS_C%,6,"Oder",FALSE&
  48. SMTEXT SMTPOS_C%,16,"alles",FALSE&
  49. SMTEXT SMTPOS_C%,26,"zentriert",FALSE&
  50. SMTEXT SMTPOS_C%,36,"!!",TRUE&
  51. ok&=ShowMsg&(SADD(smAlert$),0&,50&,0&)
  52.  
  53. SMTEXT SMTPOS_L%,6,"linksbündig",FALSE&
  54. SMTEXT SMTPOS_C%,6,"zentriert",FALSE&
  55. SMTEXT SMTPOS_R%,6,"rechtsbündig",FALSE&
  56. SMTEXT 200,16,"absolute X-Pos 200 v.l.",TRUE&
  57. ok&=ShowMsg&(SADD(smAlert$),0&,30&,0&)
  58.  
  59. OPEN "I",#1,"S:PCD"                    ' Diese Anwendung sollte man jedoch
  60. y%=6                                ' mit Vorsicht genießen, da einiges
  61. WHILE NOT EOF(1)                    ' schiefgehen kann, wenn die Datei
  62.     LINE INPUT #1,l$                ' größer als eine Bildschirmseite ist
  63.     SMTEXT SMTPOS_L%,y%,l$,EOF(1)    ' oder Zeilen enthält, die breiter
  64.     y%=y%+10                        ' als 80 Zeichen sind !!
  65. WEND
  66. CLOSE #1
  67. y%=y%+14
  68. ok&=ShowMsg&(SADD(smAlert$),0&,y%,0&)
  69.  
  70. SMCOLOR 3,12,0,10,FALSE&    ' neue Farbtabelle definieren
  71. SMCOLOR 4,9,0,13,FALSE&
  72. SMCOLOR 5,5,0,14,FALSE&
  73. SMCOLOR 6,0,0,15,FALSE&
  74. SMCOLOR 7,0,10,14,FALSE&
  75. SMCOLOR 8,0,14,9,FALSE&
  76. SMCOLOR 9,0,14,0,FALSE&
  77. SMCOLOR 10,5,14,0,FALSE&
  78. SMCOLOR 11,12,15,0,FALSE&
  79. SMCOLOR 12,15,13,0,FALSE&
  80. SMCOLOR 13,15,9,0,FALSE&
  81. SMCOLOR 14,15,4,0,FALSE&
  82. SMCOLOR 15,15,0,0,TRUE&
  83. SMTEXT SMTPOS_C%,5,"Das sieht natürlich alles noch nicht besonders überzeugend aus,",FALSE&
  84. txt1$="aber dies hier ist dann doch ein ganz schöner Unterschied zu der"
  85. txt2$="völlig geschmacklosen Intuition-Routine »DisplayAlert()«, oder ?!"
  86. farb%=4
  87. delta%=-1
  88. FOR x%=1 TO LEN(txt1$)
  89.     SMTEXTP x%*8+56,16,farb%,1,1,STS_Plain%,STM_Outline%,MID$(txt1$,x%,1),FALSE&
  90.     farb%=farb%+delta%
  91.     IF farb%=15 OR farb%=3 THEN delta%=-delta%
  92. NEXT x%
  93. farb%=4
  94. delta%=-1
  95. FOR x%=1 TO LEN(txt2$)
  96.     SMTEXTP x%*8+52,27,15,farb%,farb%,STS_Plain%,STM_Outline%,MID$(txt2$,x%,1),FALSE&
  97.     farb%=farb%+delta%
  98.     IF farb%=15 OR farb%=3 THEN delta%=-delta%
  99. NEXT x%
  100. SMTEXTP SMTPOS_C%,38,10,14,14,STS_Italic% OR STS_Underline%,STM_Shadow%,"So, dies sollte kursiv & unterstrichen sein, sowie einen Schatten haben.",FALSE&
  101. SMTEXTP SMTPOS_C%,49,5,1,1,STS_Plain%,STM_Outline%,"<--- bitte wählen Sie --->",FALSE&
  102. SMTEXTP SMTPOS_L%,49,12,1,1,STS_Bold%,STM_Normal%,"!! SEHR GUT !!",FALSE&
  103. SMTEXT SMTPOS_R%,49,"!! NICHT GUT !!",TRUE&
  104. ok&=ShowMsg&(SADD(smAlert$),0&,63&,SADD(smFarb$))
  105.  
  106. SMTEXTP    SMTPOS_C%,6,9,11,11,STS_Plain%,STM_Outline%,"extra.library 4.215 - Copyright © 1998-2003 - Roland Heyder",FALSE&
  107. SMTEXTP    SMTPOS_C%,18,9,15,15,STS_Plain%,STM_Outline%,"For registration send EUR 8,- or the changed amount in other currencies to:",FALSE&
  108. SMTEXTP    SMTPOS_C%,30,9,13,13,STS_Plain%,STM_Outline%,"Roland Heyder - Oberstadt 44 - 38877 Benneckenstein - Germany",TRUE&
  109. ok&=ShowMsg&(SADD(smAlert$),0&,46&,0&)
  110.  
  111. LIBRARY CLOSE
  112. END
  113.